package com.sdlh.demo.runtime;

import lombok.extern.slf4j.Slf4j;

import java.net.URL;

@Slf4j
public class RuntimeDemo {
    public static void main(String[] args) {
        try {
            URL url = RuntimeDemo.class.getClassLoader().getResource("chrome.bat");
            log.info("path={}", url);
            Runtime.getRuntime()
                   .exec(new String[]{url.getPath(), "www.sohu.com"});
        } catch (Exception e) {
            log.error("启动浏览器失败", e);
        }
    }
}
